/**
 * @filename:${entityName}Controller ${createTime}
 * @project ${project}  ${version}
 */
package ${usControllerUrl};

import ${entityUrl}.${entityName};
import ${serviceUrl}.${entityName}Service;
import com.starhub.common.bean.ResultResp;
import com.starhub.common.exception.AppException;
import com.starhub.utils.Util;
import com.starhub.engine.security.utils.SecurityUtils;
import com.starhub.engine.sys.user.bean.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
/**   
 * <p>说明： ${entityComment}API接口层</P>
 * @version: ${version}
 * @author: ${author}
 * @time    ${createTime}
 *
 */
 <#if isSwagger=="true" >
@Api(value="${entityComment}前台接口", tags = {"${entityComment}前台接口"},description = "编写者:${authorName}" )
</#if>
@RestController
@RequestMapping("/api/starhub/${entityNameLower}")
public class ${entityName}Controller {

    @Autowired
    private ${entityName}Service ${entityNameLower}Service;
    /**
    * 日志
    */
    private static final Logger log = LoggerFactory.getLogger(${entityName}Controller.class);

    /**
    * ${entityComment}信息获取
    */
    @ApiOperation(value = "${entityComment}信息获取", notes = "${entityComment}信息获取")
    @GetMapping("/getInfo/{id}")
    public ResultResp getInfo(@PathVariable Long id){
        ResultResp ResultResp = null;
        try {
            LoginUser user = SecurityUtils.getCurrentUser();
            ResultResp = ResultResp.success(${entityNameLower}Service.getInfo(user, id));
        }catch (Exception e){
            log.error(ExceptionUtils.getStackTrace(e));
            ResultResp = ResultResp.fail("接口异常："+e.getMessage(),e);
        }
        return ResultResp;
    }



}